home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / AmigaTalk_X / intuition / IDCMPFlags.st < prev    next >
Encoding:
Text File  |  2002-03-13  |  2.9 KB  |  74 lines

  1. " -------------------------------------------------------------------- "
  2. " IDCMPFlags Class is a Singleton class that allows the user to        "
  3. " reference IDCMP Flags without having to remember their actual        "
  4. " hexadecimal values.  This Class is instantiated by the Intuition     "
  5. " class.                                                               "
  6. ""
  7. " The User does NOT need to create one of these, since Intuition Class "
  8. " will instantiate the only needed instance of this Class.  See the    "
  9. " SetupIntuition.st source file for the method(s) that help the User   "
  10. " with this Class.                                                     "
  11. ""
  12. " ALL singleton classes MUST contain the following:                    "
  13. ""
  14. "   the methods:  isSingleton AND privateSetup     AND                 "
  15. "                 uniqueInstance Class instance variable.              "
  16. " -------------------------------------------------------------------- "
  17.  
  18. Class IDCMPFlags :Dictionary ! uniqueInstance !
  19. [
  20.    isSingleton
  21.      ^ true  
  22. |  
  23.    privateNew ! newinstance !
  24.      newinstance <- super new.
  25.  
  26.      ^ newinstance
  27. |
  28.    new
  29.      ^ self privateSetup
  30. |
  31.    privateSetup
  32.      (uniqueInstance isNil)
  33.        ifTrue: [uniqueInstance <- self privateNew.
  34.  
  35.                 self at: #IDCMP_SIZEVERIFY     put: 1.
  36.                 self at: #IDCMP_NEWSIZE        put: 2.
  37.                 self at: #IDCMP_REFRESHWINDOW  put: 4.
  38.                 self at: #IDCMP_MOUSEBUTTONS   put: 8.
  39.  
  40.                 self at: #IDCMP_MOUSEMOVE      put: 16r10.
  41.                 self at: #IDCMP_GADGETDOWN     put: 16r20.
  42.                 self at: #IDCMP_GADGETUP       put: 16r40.
  43.                 self at: #IDCMP_REQSET         put: 16r80.
  44.  
  45.                 self at: #IDCMP_MENUPICK       put: 16r100.
  46.                 self at: #IDCMP_CLOSEWINDOW    put: 16r200.
  47.                 self at: #IDCMP_RAWKEY         put: 16r400.
  48.                 self at: #IDCMP_REQVERIFY      put: 16r800.
  49.  
  50.                 self at: #IDCMP_REQCLEAR       put: 16r1000.
  51.                 self at: #IDCMP_MENUVERIFY     put: 16r2000.
  52.                 self at: #IDCMP_NEWPREFS       put: 16r4000.
  53.                 self at: #IDCMP_DISKINSERTED   put: 16r8000.
  54.  
  55.                 self at: #IDCMP_DISKREMOVED    put: 16r10000.
  56.  
  57.                 "16r20000 is for System use only"
  58.   
  59.                 self at: #IDCMP_ACTIVEWINDOW   put: 16r40000.
  60.                 self at: #IDCMP_INACTIVEWINDOW put: 16r80000.
  61.  
  62.                 self at: #IDCMP_DELTAMOVE      put: 16r100000.
  63.                 self at: #IDCMP_VANILLAKEY     put: 16r200000.
  64.                 self at: #IDCMP_INTUITICKS     put: 16r400000.
  65.                 self at: #IDCMP_IDCMPUPDATE    put: 16r800000.
  66.  
  67.                 self at: #IDCMP_MENUHELP       put: 16r1000000.
  68.                 self at: #IDCMP_CHANGEWINDOW   put: 16r2000000.
  69.                 self at: #IDCMP_GADGETHELP     put: 16r4000000.
  70.                ].
  71.                
  72.      ^ self "uniqueInstance??"
  73. ]
  74.